//
//  Home2ViewController.m
//  FruitsWholesaler
//
//  Created by sgone-2 on 16/4/18.
//  Copyright © 2016年 sgone. All rights reserved.
//

#import "Home2ViewController.h"
#import "DLTabedSlideView.h"
#import "One22ViewController.h"
#import "Two22ViewController.h"
@interface Home2ViewController ()<DLTabedSlideViewDelegate>


@property (weak, nonatomic) IBOutlet DLTabedSlideView *tabedSlideView;

@end

@implementation Home2ViewController









- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    
    [self creatUI];
  
    
}


-(void)creatUI
{
   self.titleLabel.text = @"订单";
    self.view.backgroundColor = [UIColor whiteColor];
    self.tabedSlideView.baseViewController = self;
    self.tabedSlideView.tabItemNormalColor = [UIColor blackColor];
    self.tabedSlideView.tabItemSelectedColor = BenSe_COLOR;
    self.tabedSlideView.tabbarTrackColor = BenSe_COLOR;
    self.tabedSlideView.tabbarBackgroundImage = [UIImage imageNamed:@"tabbarBk"];
    
     DLTabedbarItem *item1 = [DLTabedbarItem itemWithTitle:@"新订单" image:[UIImage imageNamed:@""] selectedImage:[UIImage imageNamed:@""] font:[UIFont systemFontOfSize:18]];
     DLTabedbarItem *item2 = [DLTabedbarItem itemWithTitle:@"已完成" image:[UIImage imageNamed:@""] selectedImage:[UIImage imageNamed:@""] font:[UIFont systemFontOfSize:18]];
     self.tabedSlideView.tabbarItems = @[item1, item2];
     [self.tabedSlideView buildTabbar];
     self.tabedSlideView.selectedIndex = 0;

    
    UIView *view2 = [[UIView alloc]initWithFrame:CGRectMake(ViewWidth / 2, 10, 1, 24)];
    view2.backgroundColor = BACKGROUND1;
    [self.tabedSlideView addSubview:view2];
    
    

    UIView *view3 = [[UIView alloc]initWithFrame:CGRectMake(0,43 , ViewWidth, 1)];
    view3.backgroundColor  = [UIColor colorWithRed:230.0/255 green:230.0/255 blue:244.0/255 alpha:1];
    [self.tabedSlideView addSubview:view3];
    
    
}



- (NSInteger)numberOfTabsInDLTabedSlideView:(DLTabedSlideView *)sender{
    return 2;
}


- (UIViewController *)DLTabedSlideView:(DLTabedSlideView *)sender controllerAt:(NSInteger)index{
    switch (index) {
        case 0:
        {
            
            
            One22ViewController *ctrl = [[One22ViewController alloc]initWithNibName:nil bundle:nil];
         
            return ctrl;
        }
        case 1:
        {
            Two22ViewController  *ctrl = [[Two22ViewController alloc] initWithNibName:nil bundle:nil];
            
            return ctrl;
        }
    
            
        default:
            return nil;
    }
}

@end
